/*
 * @Author: JYJ 
 * @Date: 2020-07-11 22:08:29 
 * @Desc: 场景管理
 */
namespace gf {
   export class SceneMgr extends gf.BaseClass {
        public curScene: BaseScene;
        public constructor() {
            super();
        }
        public static getInstance(): SceneMgr {
            return super.getInstance();
        }
        /**
         * 切换场景
         * @type type 场景类
         */
        public changeScene<T extends BaseScene>(type: (new () => T)): void {
            if (this.curScene) {
                this.curScene.onExit();
            }
            let cur: BaseScene = new type();
            cur.onEnter();
            this.curScene = cur;
        }
    }
}